Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

swapon: use a loopback device #156

Merged

Conversation

goneri
Copy link
Contributor

@goneri goneri commented Dec 13, 2021

btrfs does not support swapfile. With a loopback device, we bypass the
limitation.

sudo mkswap /swap.img
sudo swapon /swap.img
sudo losetup -f /swap.img
sudo mkswap $(sudo losetup --associated swap.img|sed 's,:.*,,')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm. I guess you're missing a '/' here, leading to the error:

mkswap: error: Nowhere to set up swap on?

(btw, thanks for looking at this, I failed to find time to work on this swap thing so far)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this going to work even if we run on systems w/o btrfs? I really want to keep test-setup.sh as "portable" as possible.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've not tested it but I guess that it should work on local filesystems.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you really need this step?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the tests are creating one or several VMs and it's asking some memory. iirc, the test suite got issues in the past due to this, so adding a swap file helps.

@goneri goneri force-pushed the swapon-use-a-loopback-device_13492 branch 2 times, most recently from bed72df to 335bfef Compare December 14, 2021 16:47
tools/tox-py39/pre.yml Outdated Show resolved Hide resolved
btrfs does not support swapfile. With a loopback device, we bypass the
limitation.

Also, ensure we've got the right Python 3.9 package installed.
@goneri goneri force-pushed the swapon-use-a-loopback-device_13492 branch from 335bfef to 91a8114 Compare December 14, 2021 18:29
@apatard
Copy link
Member

apatard commented Dec 20, 2021

recheck

@apatard
Copy link
Member

apatard commented Dec 20, 2021

looks like zuul is having some issues likely unrelated to this swap thing. At least the change is working on ubuntu and the fedora logs seems to show it's working there too. In previous runs, some fedora/ubuntu were related to no kvm, possibly will be solved by #158 (still waiting a little bit that dust settles before removing the draft status).

@ssbarnea what do you think about merging this PR ?

@apatard apatard added bug Something isn't working test This PR relates to tests, QA, CI. labels Jan 4, 2022
@apatard
Copy link
Member

apatard commented Jan 4, 2022

recheck

@ssbarnea
Copy link
Member

ssbarnea commented Jan 4, 2022

Zuul fails with error below, I think we need to address this first:

Error while creating domain: Error saving the server: Call to virDomainDefineXML failed: invalid argument: could not get preferred machine for /usr/bin/qemu-system-x86_64 type=kvm"

@apatard
Copy link
Member

apatard commented Jan 4, 2022

Zuul fails with error below, I think we need to address this first:

Error while creating domain: Error saving the server: Call to virDomainDefineXML failed: invalid argument: could not get preferred machine for /usr/bin/qemu-system-x86_64 type=kvm"

As said previously, this particular issue is supposed to be fixed by #158 but it needs this PR otherwise zuul will likely fail badly at least on fedora due to memory issues.

@ssbarnea ssbarnea merged commit 58a4e66 into ansible-community:main Jan 4, 2022
@ssbarnea
Copy link
Member

ssbarnea commented Jan 4, 2022

OK, lets YOLO it. ;)

apatard pushed a commit to apatard/molecule-vagrant that referenced this pull request Jan 4, 2022
Co-authored-by: Sorin Sbarnea <ssbarnea@redhat.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working test This PR relates to tests, QA, CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants